package cn.iocoder.devlop.module.annual.report.websiteinfo.dal;

import cn.iocoder.devlop.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.devlop.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.devlop.framework.mybatis.core.query.MPJLambdaWrapperX;
import cn.iocoder.devlop.module.annual.report.websiteinfo.dal.dataobject.WebsiteinfoDO;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * 企业年报网站或网店信息 Mapper
 *
 * @author 孙浩
 */
@Mapper
public interface WebsiteinfoMapper extends BaseMapperX<WebsiteinfoDO> {

    default List<WebsiteinfoDO> selectListByAncheid(String ancheid) {
        MPJLambdaWrapperX<WebsiteinfoDO> wrapperX = new MPJLambdaWrapperX<>();
        wrapperX.selectAll(WebsiteinfoDO.class)
                .disableLogicDel()
                .disableSubLogicDel()
                .eq(WebsiteinfoDO::getAncheid, ancheid);
        return selectJoinList(WebsiteinfoDO.class, wrapperX);
    }

    default void deleteWebsiteinfo(String ancheid){
        LambdaQueryWrapperX<WebsiteinfoDO> wrapperX = new LambdaQueryWrapperX<>();
        wrapperX.eq(WebsiteinfoDO::getAncheid,ancheid);
        int delete = delete(wrapperX);
    }

}
